var addressSelect = getClassName("address-select",document);
addressSelect[0].className = "address-select fl current";//初始化
for (var i = 0;i<addressSelect.length;i++){
	addressSelect[i].onclick = function () {
		for (var j = 0;j<addressSelect.length;j++){
			addressSelect[j].className = "address-select fl"
		}
		this.className = "address-select fl current";
	}
}

/*className兼容*/
function getClassName(cla,ele){
	var ele = ele||document;
	if(ele.getElementsByClassName){
		return ele.getElementsByClassName(cla); 
	}else{
		var all = ele.getElementsByTagName("*");//找到页面上所有的标签
		var arr = [];
		for(var i = 0;i<all.length;i++){
			var clas = all[i].className.split(' ');
			for(var j = 0;j<clas.length;j++){
				if(clas[j]==cla){
					arr.push(all[i]);
				}
			}
		}
		return arr;
	}
}


var optional = document.getElementById("optional");
var optionalContent = document.getElementById("optional-content");
optional.oninput = function () {
	if (this.value == "") {
		optionalContent.style.display = "block";
	}else {
		optionalContent.style.display = "none";
	}
}